<template>
    <div class="name-box">
        <el-input v-model="name" placeholder="名称"></el-input>
        <el-row>
            <el-col :span="24">
                <el-checkbox v-model="display">显示</el-checkbox>
                <el-checkbox v-model="stepSelection">自由步骤选择</el-checkbox>
            </el-col>
        </el-row>
        <div>
            <el-button type="primary" size="small " @click="newTempSave">保存</el-button>
            <el-button type="info" plain size="small " @click="cancel">取消</el-button>

        </div>
    </div>
</template>

<script>
import { Message } from 'element-ui';
export default {
    name: "nameBox",
    data() {
        return {
            name: "",
            display: false,
            stepSelection: false,
            category: true,
            stepSelectionDisplay: true

        }
    },
    methods: {
        newTempSave() {
            this.$store.dispatch("newTempSave", { fatherId: this.$route.params.row, name: this.name, display: this.display, stepSelection: this.stepSelection, category: this.category, stepSelectionDisplay: this.stepSelectionDisplay })
            this.$message({
                showClose: true,
                message: '保存成功',
                type: 'success'
            });
            this.$router.push("/temManage")
        }
        , cancel() {
            this.$router.push("/temManage")
        }

    },
    components: {
        Message,

    }


}
</script>

<style scoped>
.name-box {
    display: flex;
    flex-direction: column;
    padding: 10px 0px;
    border-top: 1px solid#d2d6de;
    border-bottom: 1px solid #d2d6de;
    margin: 10px 0px;
    background-color: white;

}
</style>